/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.mallsite.modules.shop.entity.GoodsBrand;
import com.mallsite.modules.shop.dao.GoodsBrandDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 商品品牌Service
 * @author ruyang
 * @version 2020-12-04
 */
@Service
@Transactional(readOnly=true)
public class GoodsBrandService extends CrudService<GoodsBrandDao, GoodsBrand> {
	
	/**
	 * 获取单条数据
	 * @param goodsBrand
	 * @return
	 */
	@Override
	public GoodsBrand get(GoodsBrand goodsBrand) {
		return super.get(goodsBrand);
	}
	
	/**
	 * 查询分页数据
	 * @param page 分页对象
	 * @param goodsBrand
	 * @return
	 */
	@Override
	public Page<GoodsBrand> findPage(Page<GoodsBrand> page, GoodsBrand goodsBrand) {
		return super.findPage(page, goodsBrand);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param goodsBrand
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(GoodsBrand goodsBrand) {
		super.save(goodsBrand);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(goodsBrand.getId(), "brandLogo_image");
		FileUploadUtils.saveFileUpload(goodsBrand.getId(), "brandCover_image");
	}
	
	/**
	 * 更新状态
	 * @param goodsBrand
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(GoodsBrand goodsBrand) {
		super.updateStatus(goodsBrand);
	}
	
	/**
	 * 删除数据
	 * @param goodsBrand
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(GoodsBrand goodsBrand) {
		super.delete(goodsBrand);
	}
	
}